<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap jj">
	<ul class="nav nav-tabs">
     <li class="active"><a href="#one" data-toggle="tab">数据配置</a></li>
      <li ><a href="#two" data-toggle="tab">顶部图片配置</a></li>
  </ul>
  <div class="common-form">
  <style type="text/css">
  	td img{ width:120px; height:auto;}
  </style>
    <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Admin/Setting/pageconfig')}">
	   
	  <div class="tabbable">
      <div class="tab-content">
	    <div class="tab-pane active" id="one">
	    <table cellpadding="2" cellspacing="2" width="100%">
	        <tbody>

	        	<tr>
	        		<td>平台入驻微号:</td>
	        		<td>
	        			<input type="text" class="input mr5" name="havewh" value="{$havewh}" />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td>推广覆盖人数:</td>
	        		<td>
	        			<input type="text" class="input mr5" name="fgmen" value="{$fgmen}" />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td>最新接单自体:</td>
	        		<td>
	        			<input type="text" class="input mr5" name="havezt" value="{$havezt}" />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td>价格:</td>
	        		<td>
	        			<input type="text" class="input mr5" name="price" value="{$price}" />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	
	        	
			</tbody>
	    </table>
	    </div>
	      <div class="tab-pane " id="two">
	      	 <table cellpadding="2" cellspacing="2" width="100%">
	        <tbody>

	        	<tr>
	        		<td>顶部图片一:</td>
	        		<td>
	        			<if condition="$img1 neq ''">
							    <img src="{$img1}" />
							    </if>
	        			<input type="text" class="input mr5" name="img1" id="img1" value="{$img1}" />
	        			<input type="file" onchange="ImgUpload(this,'#img1');" id="avatar_uploder1"  name="file"   />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	<tr>
	        		<td>顶部图片二:</td>
	        		<td>
	        			<if condition="$img2 neq ''">
							    <img src="{$img2}" />
							    </if>
	        			<input type="text" class="input mr5" name="img2" id="img2" value="{$img2}" />
	        			<input type="file" onchange="ImgUpload(this,'#img2');" id="avatar_uploder2"  name="file"   />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	
	        	<tr>
	        		<td>中部图片:</td>
	        		<td>
	        			<if condition="$img3 neq ''">
							    <img src="{$img3}" />
							    </if>
	        			<input type="text" class="input mr5" name="img3" id="img3" value="{$img3}" />
	        			<input type="file" onchange="ImgUpload(this,'#img3');" id="avatar_uploder3"  name="file"   />
	        			<span class="must_red">*</span>
	        		</td>
	        	</tr>
	        	
	        	<tr>
	        		<td>品牌客户:</td>
	        		<td>
	        			<span>
	        				<if condition="$img4 neq ''">
							    <img src="{$img4}" />
							    </if>
	        			</span>
	        			<input type="text" class="input mr5" name="img4" id="img4" value="{$img4}" />
	        			<input type="file" onchange="ImgUpload(this,'#img4');" id="avatar_uploder4"  name="file"   />
	        			<span class="must_red">*（渠道合作）</span>
	        		</td>
	        	</tr>

			</tbody>
	    </table>
	      	
	      	
	      
	      </div>
	      
	   </div>
	   </div> 
	    
	    
  		<div class="form-actions">
            <button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">确定</button>
       </div>
    </form>
  </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript">


function ImgUpload(obj,dr){
	var $fileinput=$(obj);
	var dr=$(dr);
	var id=$fileinput.attr("id");
	Wind.css("jcrop");
	Wind.use("ajaxfileupload","jcrop","noty",function(){
		$.ajaxFileUpload({
			url:"{:U('admin/forepart/updateImg')}",
			secureuri:false,
			fileElementId:id,
			dataType: 'json',
			data:{},
			success: function (data, status){
			
				if(data.status==1){
					
					dr.val(data.data.file);
	
					dr.parent().find("span").eq(0).html('<img src="'+data.data.file+'" />');
				}else{
					noty({text: data.info,
                		type:'error',
                		layout:'center'
                	});
				}
				
			},
			error: function (data, status, e){}
		});
	});

	return false;
}
</script>
</body>
</html>